//
//  MZDemoSupprot.m
//  MZBaseDemo
//
//  Created by Chris Yang on 2016/12/5.
//  Copyright © 2016年 Chris Yang. All rights reserved.
//

#import "MZDemoSupprot.h"

@implementation MZDemoSupprot

+ (UIScrollView *)mzDemoScrollView {
    return [[UIScrollView alloc] init];
}

+ (UIView *)mzDemoView {
    return [[UIView alloc] init];
}

+ (UIButton *)mzDemoButton {
    
    UIButton *button = [[UIButton alloc] init];
    
    /* Bg Color */
    [button setBackgroundColor:mzDemoBgColor];
    
    /* Title Color */
    [button setTitleColor:mzDemoTextColorRed forState:UIControlStateNormal];
    [button setTitleColor:mzDemoRandColor(0.8) forState:UIControlStateHighlighted];
    [button setTitleColor:mzDemoTextColorGreen forState:UIControlStateSelected];
    [button setTitleColor:mzDemoTextColorGray forState:UIControlStateDisabled];
    
    /* Base */
    [button.titleLabel setFont:[UIFont systemFontOfSize:20]];
    [button.titleLabel setAdjustsFontSizeToFitWidth:YES];
    
    [button.layer setBorderWidth:2];
    [button.layer setBorderColor:mzDemoBorderColor.CGColor];
    [button setClipsToBounds:YES];
    [button.layer setCornerRadius:5];
    
    return button;
}

+ (UILabel *)mzDemoLabel {
    
    UILabel *label = [[UILabel alloc] init];
    
    [label setBackgroundColor:mzDemoBgColor];
    
    [label setAdjustsFontSizeToFitWidth:YES];
    
    [label.layer setBorderWidth:2];
    [label.layer setBorderColor:mzDemoBorderColor.CGColor];
    [label setClipsToBounds:YES];
    [label.layer setCornerRadius:5];

    return label;
}

+ (UITextField *)mzDemoField {
    
    UITextField *textField = [[UITextField alloc] init];
    
    /* Bg Color */
    [textField setBackgroundColor:mzDemoBgColor];
    
    [textField.layer setBorderWidth:2];
    [textField.layer setBorderColor:mzDemoBorderColor.CGColor];
    [textField setClipsToBounds:YES];
    [textField.layer setCornerRadius:5];
    
    return textField;
}

@end
